package day08;
/*形状工厂：该类负责用来生产形状
 * 工厂模式--简单工厂
 * 目标：用一种统一的方法创建指定的父类的任意子类
 */
public class CarFactory {
	
		public static final int BIGCAR =1;
		public static final int SMALLCAR =2;
	
	public static Car getCar(int type) {
		
		Car s =null;
		if (type == BIGCAR) {
			s =new BigCar();
		} else if(type == SMALLCAR) {
			s =new SmallCar();
		}
		else {
			System.out.println("输入有误");
		}
		return s;
		
	}


	}